Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude obj callback strict #320

Merged
merged 1 commit into from Jun 15, 2022

Conversation

mskhviyu
Copy link
Contributor

@mskhviyu mskhviyu commented May 24, 2022

Added to deep diff exclude_obj_callback_strict parameter which use AND instead OR

Copy link
Owner

@seperman seperman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mskhviyu
Thanks for the PR. :)
I had a comment. Curious what your thoughts are on how this should work when ignore_order=True

deepdiff/diff.py Outdated
@@ -94,6 +94,7 @@ def _report_progress(_stats, progress_logger, duration):
'ignore_type_subclasses',
'ignore_string_case',
'exclude_obj_callback',
'exclude_obj_callback_strict',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mskhviyu
I wonder if this should be passed to DeepHash or not. When doing deephash calculations, we don't have both of the objects. We have only one of them.

Here in your unit test, if we set the exclude_obj_callback_strict and also ignore_order=True, it should throw and exception since DeepHash does not accept that parameter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my mistake, I didn't want to add to deephash. Removed from DEEPHASH_PARAM_KEYS, now my unit test passes successfully with the ignore_order=True parameter

@mskhviyu mskhviyu force-pushed the exclude_obj_callback_strict branch from 4722bf8 to 0f6cf19 Compare June 2, 2022 22:12
@mskhviyu mskhviyu requested a review from seperman June 4, 2022 22:38
@seperman
Copy link
Owner

seperman commented Jun 5, 2022

@mskhviyu Thanks for the update. There is one test that is failing: test_delta_view_and_to_delta_dict_are_equal_when_parameteres_passed.

All it needs is this new parameter to be added to _parameters in the test.

@mskhviyu mskhviyu force-pushed the exclude_obj_callback_strict branch from 0f6cf19 to 0f90957 Compare June 6, 2022 17:55
@mskhviyu mskhviyu requested a review from seperman June 6, 2022 18:04
@mskhviyu
Copy link
Contributor Author

mskhviyu commented Jun 8, 2022

@mskhviyu Thanks for the update. There is one test that is failing: test_delta_view_and_to_delta_dict_are_equal_when_parameteres_passed.

All it needs is this new parameter to be added to _parameters in the test.

@seperman done

@seperman seperman merged commit bc5311a into seperman:dev Jun 15, 2022
@seperman
Copy link
Owner

Thanks for the PR @mskhviyu
I will keep you posted once I cut a release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants